<?php
/**
 * Created by PhpStorm.
 * User: sunzexin
 * Date: 2018/1/9
 * Time: 11:51
 */

namespace App;


use Illuminate\Database\Eloquent\Model;

class VipCardRule extends Model
{
    //指定表名
    protected $table='vip_card_rule';
    // 开启自动时间戳
    public $timestamps = true;
    // 日期都存储为时间戳
    protected $dateFormat = 'U';

    public function vipCard()
    {
        return $this->belongsToMany('App\VipCard', 'vip_card_rule_value', 'vip_card_rule_id', 'vip_card_id');
    }

    public function vipCardRuleValue()
    {
        return $this->hasMany('App\VipCardRuleValue', 'vip_card_rule_id', 'id');
    }
}